pg_dump -U sumz -d air_province | gzip > backup_file.gz

docker run --rm --name pg-dump-container -e PGPASSWORD=XXXxxx postgres pg_dump -h 10.102.14.83 -U sumz -d air_province ./air_province.sql

pg_dump -U username -d dbname | gzip > backup_file.gz

#导出
/usr/local/bin/kubectl exec polardb-postgresql-0 -n base -ti -- /home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/pg_dump -U sumz -h 127.0.0.1 -d $project_name > /tmp/$bak_name
kubectl exec -n base postgresql-0 -ti -- env PGPASSWORD="Sumzxxxx" pg_dump -U sumz -h 127.0.0.1 -d air_province > /tmp/air_province

#导入
cat sz.sql | /usr/local/bin/kubectl exec -n base -i polardb-postgresql-0 -- /home/postgres/tmp_basedir_polardb_pg_1100_bld/bin/psql -U postgres -h 127.0.0.1 -d sz

cat bus.sql | kubectl exec -n base -i postgresql-ha-postgresql-0 -- /bin/sh -c "export PGPASSWORD=123456 && psql -U sumz -d bus"

cat sz.sql | /usr/local/bin/kubectl exec -n base -i polardb-postgresql-0 -- psql -U postgres -h 127.0.0.1 -d air_province

cat air_province202508051019.sql | docker exec -i b375793b8283 psql -U sumz -d air_province
nohup sh -c "cat air_province202508051019.sql | docker exec -i b375793b8283 psql -U sumz -d air_province" > /home/sumz/air_import.out 2>&1 &

cat sh_sys.sql | docker exec -i sumz-polardb-postgresql.base-1 psql -U sumz -d sh_sys

docker run --rm --name pg-dump-container -e PGPASSWORD=XXXxxx reg.sumztech.com:100/sumzbase/postgres:latest pg_dump -h 192.168.0.1 -p 15432 -U sumz -d air_province ./air_province.sql